﻿//Author:Michal Sporna
//License: https://operationsneakpeek.codeplex.com/license

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Util.Classes
{
    public class Font
    {
        #region properties
        public SpriteFont FontFace;
        public string Name; //name of the font



        #endregion


        #region methods

        /// <summary>
        /// Draw string
        /// </summary>
        /// <param name="location"></param>
        /// <param name="scale"></param>
        /// <param name="color"></param>
        public void DrawString(string text, Vector2 location, float scale, Color color)
        {
            ////declare
            //Vector2 fontOrigin;

            ////process

            //fontOrigin = this.FontFace.MeasureString(text)/2;
            //// Draw the string
            //Util.Cache.spriteBatch.DrawString(this.FontFace, text, location, color,
            //    0, fontOrigin, 0.8f, SpriteEffects.None, 0.5f);

            try
            {
                Util.Cache.DrawString(this.FontFace, text, location,scale, color);
            }
            catch (Exception ex)
            {
                Util.ErrorLogging.LogError(ex);
                return;

            }
        }


        #endregion

    }
}
